package com.soulkun.smarthome.logic.utils

import com.soulkun.smarthome.logic.exception.ApiException
import soulkun.library.utils.toast

object ExceptionUtils {

    fun catchException(e: Throwable) {
        e.printStackTrace()
        when (e) {
            is ApiException -> {
                e.errorMessage.toast()
            }
            else -> {
                "发生未知错误，请检查网络状态等".toast()
            }
        }
    }

}